Skip to content

docs: add feature flag contributor guide for gating new features#1149

Closed
bobbravo2 wants to merge 3 commits intomainfrom
docs/feature-flag-contributor-guide
Closed

docs: add feature flag contributor guide for gating new features#1149
bobbravo2 wants to merge 3 commits intomainfrom
docs/feature-flag-contributor-guide

Conversation

@bobbravo2
Copy link
Copy Markdown
Member

@bobbravo2 bobbravo2 commented Apr 2, 2026

Summary

  • Adds docs/internal/developer/adding-a-feature.md — a step-by-step walkthrough for contributors to gate new features behind feature flags (naming, registration in flags.json, backend/frontend gating, visibility choice, and testing)
  • Adds a feature-flag requirement to CONTRIBUTING.md in both the "Make Your Changes" workflow and the "Before Submitting" PR checklist
  • Links the new guide from docs/internal/developer/README.md alongside the existing feature-flags docs and ADR-0007
  • Adds a "Feature Flags" section to BOOKMARKS.md for discoverability

Closes the gap between ADR-0007's mandate ("all new features must be flag-gated") and the contributor-facing docs, which previously never mentioned feature flags.

Test plan

  • Verify all relative links resolve correctly in a local docs build or GitHub rendering
  • Confirm flags.json path referenced in the guide matches the actual file location
  • Review code examples against current handlers/featureflags.go and @/lib/feature-flags APIs

Made with Cursor

Summary by CodeRabbit

  • Documentation
    • Added a Feature Flags section across docs with links to an overview, an adding-a-feature guide, and a fail-modes reference
    • Updated CONTRIBUTING to require gating new user-facing features behind feature flags and added checklist guidance
    • Added an internal developer guide detailing end-to-end feature-flag workflows, testing, and evaluation precedence

Contributors had no clear path from "all features must be flag-gated"
(ADR-0007) to the concrete steps needed. This adds a step-by-step
walkthrough and surfaces it where contributors actually look.

Made-with: Cursor
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 2, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 69b8c624-5e98-43f2-aa70-1c941ccefbb5

📥 Commits

Reviewing files that changed from the base of the PR and between 9230bff and 8783ae8.

📒 Files selected for processing (1)
  • BOOKMARKS.md
✅ Files skipped from review due to trivial changes (1)
  • BOOKMARKS.md

📝 Walkthrough

Walkthrough

Adds comprehensive feature-flag documentation across docs and bookmarks, and updates contributing guidelines to require gating all new user-facing features behind feature flags. Introduces a detailed developer guide describing naming, registration, sync, backend/frontend gating patterns, testing, and evaluation precedence.

Changes

Cohort / File(s) Summary
Documentation Indexes
BOOKMARKS.md, docs/internal/developer/README.md
Inserted a "Feature Flags" section with links to a step-by-step guide, an overview, and ADR-0007 (Unleash) references.
Contribution Workflow
CONTRIBUTING.md
Added requirement to gate all new user-facing features behind feature flags in branch workflow and PR "Before Submitting" checklist; linked to the feature-flag guide.
Feature Flag Developer Guide
docs/internal/developer/adding-a-feature.md
New detailed guide covering flag naming (<component>.<feature>.<aspect>), registration in components/manifests/.../flags.json and models.json, startup sync via cmd/sync_flags.go, backend gating patterns (handlers/featureflags.go), frontend gating (Unleash React useFlag, workspace-scoped useWorkspaceFlag), flag scope choices, local testing for fail-open/closed, and evaluation precedence (workspace overrides → Unleash SDK → code defaults).
🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Title follows Conventional Commits format (docs: ...), clearly describes adding feature flag documentation, and directly aligns with the PR's primary objective of providing contributor guidance.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Performance And Algorithmic Complexity ✅ Passed Pull request contains only documentation changes (4 markdown files, 196 lines added) with no code modifications, preventing performance regressions or algorithmic complexity issues.
Security And Secret Handling ✅ Passed PR contains only documentation updates with no security violations, hardcoded secrets, embedded tokens, or unsafe auth patterns detected.
Kubernetes Resource Safety ✅ Passed PR contains only documentation changes (BOOKMARKS.md, CONTRIBUTING.md, developer guides). No Kubernetes manifests, RBAC policies, or infrastructure code modified.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/feature-flag-contributor-guide
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch docs/feature-flag-contributor-guide

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/internal/developer/adding-a-feature.md`:
- Line 32: The docs reference a non-existent Make target deploy-unleash-kind;
either add a Makefile target named deploy-unleash-kind that runs the appropriate
Kind deployment steps to apply the manifests under
components/manifests/base/core (including flags.json and models.json), or update
the documentation to point to the actual existing Make target that performs the
same Kind deployment. Modify the Makefile to include a deploy-unleash-kind
recipe that executes the cluster creation/apply sequence for the Unleash
manifests, or change the doc line referencing deploy-unleash-kind to the correct
target name and include any required flags/notes to deploy to a Kind cluster.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5730ce82-eb0d-4598-b73a-bc8f5eed5c16

📥 Commits

Reviewing files that changed from the base of the PR and between 4b12c81 and 9230bff.

📒 Files selected for processing (4)
  • BOOKMARKS.md
  • CONTRIBUTING.md
  • docs/internal/developer/README.md
  • docs/internal/developer/adding-a-feature.md


### General / runner flags

Add an entry to `components/manifests/base/core/flags.json`:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify manifest files and Make targets exist

# Check flags.json
if [[ -f "components/manifests/base/core/flags.json" ]]; then
  echo "✓ components/manifests/base/core/flags.json exists"
else
  echo "✗ components/manifests/base/core/flags.json NOT FOUND"
fi

# Check models.json
if [[ -f "components/manifests/base/core/models.json" ]]; then
  echo "✓ components/manifests/base/core/models.json exists"
else
  echo "✗ components/manifests/base/core/models.json NOT FOUND"
fi

# Check Make targets
if grep -q "^deploy-unleash-kind:" Makefile; then
  echo "✓ Make target 'deploy-unleash-kind' found"
else
  echo "✗ Make target 'deploy-unleash-kind' NOT FOUND"
fi

if grep -q "^unleash-port-forward:" Makefile; then
  echo "✓ Make target 'unleash-port-forward' found"
else
  echo "✗ Make target 'unleash-port-forward' NOT FOUND"
fi

Repository: ambient-code/platform

Length of output: 256


🏁 Script executed:

cat -n docs/internal/developer/adding-a-feature.md | sed -n '25,65p'

Repository: ambient-code/platform

Length of output: 1663


🏁 Script executed:

grep -n "deploy-unleash-kind\|unleash-port-forward" docs/internal/developer/adding-a-feature.md

Repository: ambient-code/platform

Length of output: 195


🏁 Script executed:

cat -n docs/internal/developer/adding-a-feature.md | sed -n '150,165p'

Repository: ambient-code/platform

Length of output: 671


make deploy-unleash-kind target missing.

The guide references make deploy-unleash-kind at line 158 to deploy Unleash to a Kind cluster, but this Make target does not exist. The manifest files referenced (components/manifests/base/core/flags.json and models.json) are correct and present. Add the missing Make target or update the documentation with the correct deployment command.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/internal/developer/adding-a-feature.md` at line 32, The docs reference a
non-existent Make target deploy-unleash-kind; either add a Makefile target named
deploy-unleash-kind that runs the appropriate Kind deployment steps to apply the
manifests under components/manifests/base/core (including flags.json and
models.json), or update the documentation to point to the actual existing Make
target that performs the same Kind deployment. Modify the Makefile to include a
deploy-unleash-kind recipe that executes the cluster creation/apply sequence for
the Unleash manifests, or change the doc line referencing deploy-unleash-kind to
the correct target name and include any required flags/notes to deploy to a Kind
cluster.

@ambient-code ambient-code Bot added this to the Review Queue milestone Apr 2, 2026
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 17, 2026

Deploy Preview for cheerful-kitten-f556a0 canceled.

Name Link
🔨 Latest commit 9fe5f1f
🔍 Latest deploy log https://app.netlify.com/projects/cheerful-kitten-f556a0/deploys/69e1a60edd0c970008f68ca6

@jeremyeder
Copy link
Copy Markdown
Contributor

I added skills for dealing with unleash and for adding new features like integrations and whatnot. Check PR1307. gonna close this.

@jeremyeder jeremyeder closed this Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants